#pragma once
#include "Character.h"
#include "Socket.h"

#include "Buffer.h"

class Player : public Character
{
public:
typedef void(*player_function)(Player*);

	Player(void);
	Player(Socket* _socket, int _entity_index, int _x, int _y, int _h = 0);

	unsigned char disconnect; //this is set to 60000 / (update time). if the user is in combat, it ticks down until 1 for a disconnect. otherwise if its > 0 the player is removed from the server
	Socket* socket;
	Buffer* in_buffer;
	Buffer* out_buffer;
	char* username;
	char* password;

	unsigned short PROTOCOL_VERSION;

	int get_data(int amount);
	int flush_data();

	/*
	 * begin the hell that is function pointers for multi-revision possibility
	 */

	player_function method_login;

	/*
	 * end the hell
	 */

	~Player(void);
};